/*     */ package com.lmpop.trade.ti_membercurrency;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.io.PrintStream;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_membercurrencyInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_membercurrencyInfo()
/*     */   {
/*  19 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     String pkid_string = map.getString("pkid");
/*  25 */     String result_code = "0";
/*     */     try {
/*  27 */       if (!pkid_string.equals("")) {
/*  28 */         String[] pkStr = pkid_string.split("\\|");
/*  29 */         for (int i = 0; i < pkStr.length; i++) {
/*  30 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  34 */       e.printStackTrace();
/*  35 */       result_code = "1";
/*     */     }
/*  37 */     map.setString("result_code", result_code);
/*  38 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid) throws ApplicationException {
/*  42 */     dbmMgr.update("deleteTi_membercurrencyInfo", pkid);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj) {
/*  46 */     Map ti_membercurrency = (Hashtable)obj;
/*  47 */     List list = this.queryList.getList("getCountByObjTi_membercurrency", ti_membercurrency);
/*  48 */     int count = 0;
/*  49 */     if ((list != null) && (list.size() > 0)) {
/*  50 */       Hashtable newsMap = (Hashtable)list.get(0);
/*  51 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/*  52 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/*  55 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit) {
/*  59 */     Map ti_membercurrency = (Hashtable)obj;
/*  60 */     if (start == 0)
/*  61 */       start = 0;
/*     */     else {
/*  63 */       start = (start - 1) * limit;
/*     */     }
/*  65 */     ti_membercurrency.put("start", Integer.valueOf(start));
/*  66 */     ti_membercurrency.put("limit", Integer.valueOf(limit));
/*  67 */     return this.queryList.getList("getListByTi_membercurrencyPage", ti_membercurrency);
/*     */   }
/*     */ 
/*     */   public List getListByPk(String id)
/*     */   {
/*  73 */     return this.queryList.getList("getTi_membercurrencyByPk", id);
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map) {
/*  77 */     RandomID randomID = new RandomID();
/*  78 */     String trade_id = randomID.GenTradeId();
/*  79 */     Ti_membercurrency ti_membercurrency = new Ti_membercurrency();
/*  80 */     ti_membercurrency.setMemberscurrency_id(trade_id);
/*  81 */     ti_membercurrency.setCase_levelname(map.getString("case_levelname"));
/*  82 */     ti_membercurrency.setDeductions(map.getString("deductions"));
/*  83 */     String result_code = "0";
/*     */     try {
/*  85 */       insert(dbmMgr, ti_membercurrency);
/*     */     } catch (ApplicationException e) {
/*  87 */       e.printStackTrace();
/*  88 */       result_code = "1";
/*     */     }
/*  90 */     map.setString("result_code", result_code);
/*  91 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_membercurrency ti_membercurrency) throws ApplicationException {
/*  95 */     dbmMgr.update("insertTi_membercurrency", ti_membercurrency);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 101 */     Ti_membercurrency ti_membercurrency = new Ti_membercurrency();
/* 102 */     ti_membercurrency.setMemberscurrency_id(map.getString("memberscurrency_id"));
/* 103 */     ti_membercurrency.setCase_levelname(map.getString("case_levelname"));
/* 104 */     ti_membercurrency.setDeductions(map.getString("deductions"));
/* 105 */     String result_code = "0";
/*     */     try {
/* 107 */       update(dbmMgr, ti_membercurrency);
/*     */     } catch (ApplicationException e) {
/* 109 */       e.printStackTrace();
/* 110 */       result_code = "1";
/*     */     }
/* 112 */     map.setString("result_code", result_code);
/* 113 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_membercurrency ti_membercurrency)
/*     */     throws ApplicationException
/*     */   {
/* 121 */     dbmMgr.update("updateTi_membercurrency", ti_membercurrency);
/*     */   }
/*     */ 
/*     */   public String getSelectString(String cust_class_params)
/*     */   {
/* 127 */     List list = this.queryList.getList("getListByTi_membercurrencySelect");
/* 128 */     String selectString = "";
/* 129 */     String memberscurrency_id = "";
/* 130 */     String case_levelname = "";
/* 131 */     if ((list != null) && (list.size() > 0)) {
/* 132 */       for (int i = 0; i < list.size(); i++) {
/* 133 */         Hashtable newsMap = (Hashtable)list.get(i);
/* 134 */         if ((newsMap.get("memberscurrency_id") != null) && (!newsMap.get("memberscurrency_id").toString().equals(""))) {
/* 135 */           memberscurrency_id = newsMap.get("memberscurrency_id").toString();
/*     */         }
/* 137 */         if ((newsMap.get("case_levelname") != null) && (!newsMap.get("case_levelname").toString().equals(""))) {
/* 138 */           case_levelname = newsMap.get("case_levelname").toString();
/*     */         }
/* 140 */         if (memberscurrency_id.equals(cust_class_params))
/* 141 */           selectString = selectString + "<option value='" + memberscurrency_id + "'selected>" + case_levelname + "</option>";
/*     */         else {
/* 143 */           selectString = selectString + "<option value='" + memberscurrency_id + "'>" + case_levelname + "</option>";
/*     */         }
/*     */       }
/*     */     }
/* 147 */     return selectString;
/*     */   }
/*     */ 
/*     */   public List getListByCase_level(String case_level) {
/* 151 */     return this.queryList.getList("getTi_membercurrencyByCase_level", case_level);
/*     */   }
/*     */ 
/*     */   public int checkName(String case_levelname) {
/* 155 */     List user_list = this.queryList.getList("checkName", case_levelname);
/* 156 */     System.out.print("%%%%%%%%%%%%%%%%%%%%%" + user_list.size() + "$$$$$$$$$$$$$$$$$$$$");
/* 157 */     if ((user_list != null) && (user_list.size() > 0)) {
/* 158 */       return 1;
/*     */     }
/* 160 */     return 0;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_membercurrency.Ti_membercurrencyInfo
 * JD-Core Version:    0.6.0
 */